<div style="height:auto; overflow:scroll;">
	<table class="table table-border table-bordered table-hover table-bg table-striped" style="width: 1700px;">
		<thead>
			<tr class="text-c">
				<th width="30">No.</th>
				<th width="80">客户</th>
				<th width="120">合同号</th>
				<th width="50">房号</th>
				<th width="50">押金</th>
				<th width="50">房租</th>
				<th width="50">定金</th>
				<th width="50">物业费</th>
				<th width="50">水费</th>
				<th width="50">电费</th>
				<th width="50">房卡</th>
				<th width="50">减免</th>
				<th width="50">合计</th>
				<th width="30">状态</th>
				<th width="70">收据</th>
				<th width="50">操作</th>
				<!--
				<th>现金</th>
				<th>POS机</th>
				<th>微信</th>
				<th>支付宝</th>
				<th>信用卡</th>-->
				<th width="120">日期</th>
				<th>备注</th>
				<th width="50">管家</th>
				<!-- <th>操作</th> -->
			</tr>
		</thead>
		<tbody>
			<if condition="is_array($list) && count($list)" >
			<?php foreach($list as $k=>$ls){ ?>
				<tr class="text-c">
					<td><?php echo ($page-1)*C('PAGE_SIZE')+($k+1);?></td>
					<td>{$ls.nickname}</td>
					<td>{$ls.contract}</td>
					<td>{$ls.roomnumber}</td>
					<td>{$ls.deposit}</td>
					<td>{$ls.rent}</td>
					<td>{$ls.deposit_first}</td>
					<td>{$ls.property}</td>
					<td>{$ls.water_power}</td>
					<td>{$ls.electric}</td>
					<td>{$ls.card_deposit}</td>
					<td><?php echo $ls['typeid'] == 3 ? $ls['other'] : '0.00'; ?></td>
					<td>{$ls.acount}</td>
					<td>
						<?php if($ls['visible']){ ?>
						<!--<a href="javascript:void(0);" class="setstate" _gid="{$ls['id']}" _val="1" title="点击修改状态">有效</a>-->
						有效
						<?php }else{ ?>
						<!--<a href="javascript:void(0);" class="setstate" _gid="{$ls['id']}" _val="0" title="点击修改状态">无效</a>-->
						无效
						<?php } ?>
					</td>
					<td>
						<?php if($ls['typeid'] == 1){ ?>
							<?php if($ls['deposit'] > 0){ ?>
							<a href="excelbill.html?id={$ls['id']}&type=1">押金</a> | 
							<?php } ?>
							<a href="excelbill.html?id={$ls['id']}&type=2">费用</a> 
						<?php } ?>
					</td>
					<td>
						<a href="javascript:void(0);" title="编辑" onclick="admin_role_edit('编辑费用信息','edit.html?logid={$ls['id']}', 1,'1020', '650');" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
						<?php if(!empty($ls['images'])){ ?>
						&nbsp;&nbsp;<a href="javascript:void(0);" title="图集" onclick="admin_role_edit('查看图集','goback.html?gid={$ls['id']}', 1,'700', '500');" style="text-decoration:none"><i class="Hui-iconfont">&#xe613;</i></a>
						<?php } ?>
					</td>
					<!--
					<td>{$ls.xianjin}</td>
					<td>{$ls.lakala}</td>
					<td>{$ls.weixin}</td>
					<td>{$ls.alipay}</td>
					<td>{$ls.band}</td>-->
					<td>{$ls.createtime|date="Y-m-d H:i",###}</td>
					<td class="text-l">
						{$ls.remark}
						<?php if(!empty($ls['alipay_ordersn'])){ ?>
						<br />支付宝：{$ls['alipay_ordersn']}&nbsp;&nbsp; {$ls['weixin_ordersn'] ? '<br />' : ''}
						<?php } if(!empty($ls['weixin_ordersn'])){ ?>
						<br />微信：{$ls['weixin_ordersn']}
						<?php } ?>
					</td>
					<td>{$ls.admin_nick}</td>
					<!--
					<td>
						<?php if(!empty($ls['images'])){ ?>
						<a href="javascript:void(0);" title="图集" onclick="admin_role_edit('查看图集','goback.html?gid={$ls['id']}', 1,'700', '500');" style="text-decoration:none"><i class="Hui-iconfont">&#xe613;</i></a>
						<?php } ?>
					</td>-->
				</tr>
			<?php } ?>
			<else />
				<tr class="text-c">
					<td colspan="25">暂无数据...</td>
				</tr>
			</if>
		</tbody>
	</table>
</div>	
<!--page-->
<include file="Common/page" />
<script>
	$(document).ready(function(){
		$("a.setstate").on('click', function(){
			var obj = $(this);
			var data = {};
				data.gid = obj.attr("_gid");
				data.state = obj.attr('_val')/1 == 1 ? 0 : 1;
			var showval = data.state/1 == 1 ? '有效' : '无效';
			
			$.post('index.html', data, function(row){
				if(row/1){
					layer.msg("修改成功", {icon: 1, time:2000}, function(){
						obj.attr('_val', data.state);
						obj.html(showval);
					});
				}else{
					layer.msg("修改失败",{icon: 2, time: 2000});
				}
			});
		});
	});
</script>